﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:Controls="clr-namespace:Windows8Accelerator.Core.Xaml.Controls;assembly=W8A.C.X"
    xmlns:Converters="clr-namespace:Windows8Accelerator.Core.Xaml.Converters;assembly=W8A.C.X"
    >

    <Style TargetType="Controls:SuperFlyout">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:SuperFlyout">
                    <Grid>
                        <TextBlock Text="teste" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>   

    <Style TargetType="Controls:SuperRichTextBlock">
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <!--<Setter Property="Foreground" Value="{StaticResource ApplicationForegroundThemeBrush}"/>
        <Setter Property="FontSize" Value="{StaticResource ControlContentThemeFontSize}"/>
        <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>-->
        <!--Style="{StaticResource ItemRichTextStyle}"-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:SuperRichTextBlock">
                    <RichTextBox
                        x:Name="richTextBlock" 
                        Width="{TemplateBinding InternalColumnWidth}" 
                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                        Foreground="{TemplateBinding Foreground}"
                        FontFamily="{TemplateBinding FontFamily}"
                        FontSize="{TemplateBinding FontSize}"
                        FontStretch="{TemplateBinding FontStretch}"
                        FontStyle="{TemplateBinding FontStyle}"
                        FontWeight="{TemplateBinding FontWeight}"
                        />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="RichTextHyperlinkButtonStyle" TargetType="HyperlinkButton">
        <!--<Setter Property="Foreground" Value="{StaticResource HyperlinkForegroundThemeBrush}"/>
        <Setter Property="Background" Value="{StaticResource HyperlinkButtonBackgroundThemeBrush}"/>-->
        <Setter Property="BorderBrush" Value="{x:Null}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <!--<Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="HyperlinkButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HyperlinkPointerOverForegroundThemeBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HyperlinkPressedForegroundThemeBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource HyperlinkDisabledThemeBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualWhite"/>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualBlack"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                                <VisualState x:Name="PointerFocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle Fill="Transparent"/>
                        <ContentPresenter x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        <Rectangle x:Name="FocusVisualWhite" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="1.5" StrokeEndLineCap="Square" Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}" StrokeDashArray="1,1"/>
                        <Rectangle x:Name="FocusVisualBlack" IsHitTestVisible="False" Opacity="0" StrokeDashOffset="0.5" StrokeEndLineCap="Square" Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}" StrokeDashArray="1,1"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>-->
    </Style>


    <Style TargetType="Controls:SuperSilhouette">
        <!--<Setter Property="FullScreenLandscapePageTitleStyle" Value="{StaticResource PageHeaderTextStyle}" />
        <Setter Property="FullScreenLandscapeBackButtonStyle" Value="{StaticResource BackButtonStyle}"/>
        <Setter Property="SnappedPageTitleStyle" Value="{StaticResource SnappedPageHeaderTextStyle}" />
        <Setter Property="SnappedBackButtonStyle" Value="{StaticResource SnappedBackButtonStyle}"/>-->
        <Setter Property="FullScreenLandscapeHeaderRowHeight" Value="140" />
        <Setter Property="SnappedHeaderRowHeight" Value="80" />
        <Setter Property="ContentRowSpan" Value="1" />
        <Setter Property="ContentRow" Value="1" />
        <Setter Property="FullScreenLandscapeHeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Button x:Name="BackButton" Style="{Binding BackButtonStyle}" Command="{Binding BackButtonCommand}" Visibility="Collapsed"/>
                        <TextBlock Text="{Binding Content}" Style="{Binding PageTitleStyle}" Grid.Column="1"/>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:SuperSilhouette">
                    <Grid x:Name="root" Background="{TemplateBinding Background}">
                        <Grid.RowDefinitions>
                            <RowDefinition x:Name="HeaderRowDefinition"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <ContentPresenter ContentTemplate="{TemplateBinding DynamicHeaderTemplate}" Content="{TemplateBinding HeaderItem}" />
                        <ContentPresenter Grid.Row="{TemplateBinding ContentRow}" Grid.RowSpan="{TemplateBinding ContentRowSpan}" />
                        <ProgressBar x:Name="ProgressBar" Style="{TemplateBinding ProgressBarStyle}" IsIndeterminate="True" VerticalAlignment="Top" Visibility="Collapsed"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate x:Key="SuperListViewDefaultFullScreenLandscapeGroupHeaderTemplate">
        <ContentPresenter Content="{Binding}"/>
    </DataTemplate>

    <DataTemplate x:Key="SuperListViewDefaultFullScreenLandscapeZoomedOutTemplate">
        <ContentPresenter Content="{Binding}"/>
    </DataTemplate>

    <DataTemplate x:Key="SuperListViewDefaultFullScreenLandscapeItemTemplate">
        <ContentPresenter Content="{Binding}"/>
    </DataTemplate>

    <ItemsPanelTemplate x:Key="HorizontalGroupedItemsPanelTemplate">
        <VirtualizingStackPanel Orientation="Horizontal"/>
    </ItemsPanelTemplate>
    <ItemsPanelTemplate x:Key="HorizontalItemsPanelTemplate">
        <VirtualizingStackPanel Orientation="Vertical"/>
    </ItemsPanelTemplate>
    <ItemsPanelTemplate x:Key="VerticalGroupedItemsPanelTemplate">
        <VirtualizingStackPanel Orientation="Vertical"/>
    </ItemsPanelTemplate>
    <ItemsPanelTemplate x:Key="VerticalItemsPanelTemplate">
        <VirtualizingStackPanel Orientation="Horizontal"/>
    </ItemsPanelTemplate>

    <DataTemplate x:Key="SuperListViewDefaultGroupTemplate">
        <Controls:GroupItemControl
                ItemsSource="{Binding Items}" 
                ItemTemplate1="{Binding ItemTemplate}"
                ItemTemplateSelector="{Binding ItemTemplateSelector}"
        >
            <Controls:GroupItemControl.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                </Style>
            </Controls:GroupItemControl.ItemContainerStyle>
            <Controls:GroupItemControl.ItemTemplate>
                <DataTemplate>
                    <Controls:DataTemplateSelectorControl Content="{Binding}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" />
                </DataTemplate>
            </Controls:GroupItemControl.ItemTemplate>
        </Controls:GroupItemControl>
    </DataTemplate>

    <Style TargetType="Controls:GroupHeaderContentControl">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:GroupHeaderContentControl">
                    <ContentPresenter />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="DefaultInternalGridViewStyle" TargetType="Controls:InternalGridView" >
        <Setter Property="ItemContainerStyle">
            <Setter.Value>
                <Style TargetType="phone:PanoramaItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="phone:PanoramaItem">
                                <Grid Background="{TemplateBinding Background}" Margin="12,0,0,0">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <Controls:GroupHeaderContentControl x:Name="header" CharacterSpacing="-35" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" FontSize="66" FontFamily="{StaticResource PhoneFontFamilySemiLight}" HorizontalAlignment="Left" Margin="0">
                                        <Controls:GroupHeaderContentControl.RenderTransform>
                                            <TranslateTransform x:Name="headerTransform"/>
                                        </Controls:GroupHeaderContentControl.RenderTransform>
                                    </Controls:GroupHeaderContentControl>
                                    <ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Grid.Row="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SuperListViewDefaultSnappedViewStyle" TargetType="Controls:ListViewBaseContentControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:ListViewBaseContentControl">
                    <Controls:InternalGridView 
                        x:Name="ListViewBase"
                        ItemsSource1="{Binding}"                                
                        ItemTemplate1="{TemplateBinding ItemTemplate}"
                        ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                        ItemTemplate="{StaticResource SuperListViewDefaultGroupTemplate}"
                        ItemsPath="{TemplateBinding ItemsPath}"
                        HeaderTemplate="{TemplateBinding GroupHeaderTemplate}"
                        Style="{StaticResource DefaultInternalGridViewStyle}"
                        GroupHeaderClickCommand="{TemplateBinding GroupHeaderCommand}"
                        >
                    </Controls:InternalGridView>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="SuperListViewDefaultFullScreenLandscapeViewStyle" TargetType="Controls:ListViewBaseContentControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:ListViewBaseContentControl">
                    <!--
                        SelectionMode="{TemplateBinding SelectionMode}"
                        IsItemClickEnabled="True"
                        ItemContainerStyle="{StaticResource SuperListViewDefaultGridViewItemStyle}"
                        ItemsPanel="{TemplateBinding DynamicItemsPanelTemplate}"
                    -->
                    <Controls:InternalGridView 
                        x:Name="ListViewBase"
                        ItemsSource1="{Binding}"                                
                        ItemTemplate1="{TemplateBinding ItemTemplate}"
                        ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                        ItemTemplate="{StaticResource SuperListViewDefaultGroupTemplate}"
                        ItemsPath="{TemplateBinding ItemsPath}"
                        HeaderTemplate="{TemplateBinding GroupHeaderTemplate}"
                        Style="{StaticResource DefaultInternalGridViewStyle}"
                        GroupHeaderClickCommand="{TemplateBinding GroupHeaderCommand}"
                        >
                    </Controls:InternalGridView>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Controls:SuperListView" >
        <Setter Property="FullScreenLandscapeGroupHeaderTemplate" Value="{StaticResource SuperListViewDefaultFullScreenLandscapeGroupHeaderTemplate}" />
        <Setter Property="FullScreenLandscapeItemTemplate" Value="{StaticResource SuperListViewDefaultFullScreenLandscapeItemTemplate}" />
        <Setter Property="SnappedViewStyle" Value="{StaticResource SuperListViewDefaultSnappedViewStyle}" />
        <Setter Property="FullScreenLandscapeViewStyle" Value="{StaticResource SuperListViewDefaultFullScreenLandscapeViewStyle}" />
        <Setter Property="FullScreenLandscapeItemsPanelTemplate" Value="{StaticResource HorizontalItemsPanelTemplate}" />
        <Setter Property="FullScreenLandscapeGroupedItemsPanelTemplate" Value="{StaticResource HorizontalGroupedItemsPanelTemplate}" />
        <Setter Property="SnappedItemsPanelTemplate" Value="{StaticResource VerticalItemsPanelTemplate}" />
        <Setter Property="SnappedGroupedItemsPanelTemplate" Value="{StaticResource VerticalGroupedItemsPanelTemplate}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Controls:SuperListView">
                    <Controls:ListViewBaseContentControl 
                            x:Name="ListViewBaseContentControl"
                            Content="{TemplateBinding ItemsSource}"
                            DataContext="{TemplateBinding ItemsSource}"
                            ItemTemplate="{TemplateBinding DynamicItemTemplate}"
                            GroupHeaderTemplate="{TemplateBinding DynamicGroupHeaderTemplate}"
                            Style="{TemplateBinding DynamicViewStyle}"
                            SelectionMode="{TemplateBinding SelectionMode}"
                            ItemsPath="{TemplateBinding ItemsPath}"
                            DynamicItemsPanelTemplate="{TemplateBinding DynamicItemsPanelTemplate}"
                            ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                            GroupHeaderCommand="{TemplateBinding GroupHeaderCommand}"
                        />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="ScrollViewer"  x:Key="VerticalScrollViewerStyle" >
        
    </Style>
</ResourceDictionary>
